"""Build file for TAPA's C preprocessor (cpp)."""

# Copyright (c) 2024 RapidStream Design Automation, Inc. and contributors.
# All rights reserved. The contributor(s) of this file has/have agreed to the
# RapidStream Contributor License Agreement.

load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_files", "strip_prefix")

genrule(
    name = "gen-tapa-cpp",
    srcs = ["@tapa-llvm-project//clang"],
    outs = ["tapa-cpp"],
    cmd = "cp -r $< $@",
    visibility = ["//visibility:public"],
)

pkg_files(
    name = "pkg",
    srcs = [":gen-tapa-cpp"],
    attributes = pkg_attributes(mode = "0755"),
    prefix = "usr/bin",
    strip_prefix = strip_prefix.files_only(),
    visibility = ["//visibility:public"],
)
